
package net.tutwiz.persistence;

import java.util.List;
import javax.ejb.Local;
import javax.persistence.EntityManager;

@Local
public interface IPersistenceManager<T> {

    public abstract void save(T t);

    public abstract void delete(T t);

    public abstract void update(T t);

    public abstract T get(Long id);

    public abstract List<T> getAll();
    
    public abstract int count();

    /**
     * This is needed for testing without a web container.
     * 
     * @return 
     */
    public abstract EntityManager getEntityManager();
    
    /**
     * This is needed for testing without a web container.
     * 
     * @param em 
     */
    public abstract void setEntityManager(EntityManager em);
}